Skip to content

gh-124375: Avoid calling _PyMem_ProcessDelayed on other thread states#124459

Merged
colesbury merged 3 commits intopython:mainfrom
colesbury:gh-124375-py-mem-process-delayed
Oct 15, 2024
Merged

gh-124375: Avoid calling _PyMem_ProcessDelayed on other thread states#124459
colesbury merged 3 commits intopython:mainfrom
colesbury:gh-124375-py-mem-process-delayed

Conversation

@colesbury
Copy link
Contributor

@colesbury colesbury commented Sep 24, 2024

This fixes a crash when running the PyO3 test suite on the free-threaded build. The qsbr field is initialized after the PyThreadState is added to the interpreter's linked list -- it might still be NULL.

Instead, we "steal" the queue of to-be-freed memory blocks. This is always initialized (possibly empty) and protected by the stop the world pause.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants